From 33499debed41e6cf01be9a0ee2110a472145e2ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 15 Dec 2007 05:01:30 +0000 Subject: [PATCH] Use u32 instead of __u32 and u8 instead of __u8 as the other types are * gdk/directfb/gdkcursor-directfb.c: (gdk_cursor_new_for_display): Use u32 instead of __u32 and u8 instead of __u8 as the other types are deprecated since DirectFB 1.0.0. If compiling with an older version define the new type name to the old types. Fixes bug #503190. svn path=/trunk/; revision=19182 --- ChangeLog | 7 +++++++ gdk/directfb/gdkcursor-directfb.c | 15 +++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d908dc1f8a..abe3b41594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-15 Sebastian Dröge + + * gdk/directfb/gdkcursor-directfb.c: (gdk_cursor_new_for_display): + Use u32 instead of __u32 and u8 instead of __u8 as the other types + are deprecated since DirectFB 1.0.0. If compiling with an older + version define the new type name to the old types. Fixes bug #503190. + 2007-12-14 Ray Strode * gtk/gtkwidget.c: Suggest g_signal_connect (..., "realize", ...) diff --git a/gdk/directfb/gdkcursor-directfb.c b/gdk/directfb/gdkcursor-directfb.c index 8ab7aec7b8..5c2f92ea26 100644 --- a/gdk/directfb/gdkcursor-directfb.c +++ b/gdk/directfb/gdkcursor-directfb.c @@ -39,6 +39,13 @@ #include "x-cursors.xbm" +#include + +#if DIRECTFB_MAJOR_VERSION < 1 +#define u32 __u32 +#define u8 __u8 +#endif + static struct { const guchar *bits; int width, height, hotx, hoty; @@ -228,7 +235,7 @@ gdk_cursor_new_for_display (GdkDisplay *display,GdkCursorType cursor_type) } else { - __u32 *dst; + u32 *dst; int pitch; ret = temp->Lock (temp, DSLF_WRITE, (void**)&dst, &pitch); @@ -266,13 +273,13 @@ gdk_cursor_new_for_display (GdkDisplay *display,GdkCursorType cursor_type) gint bit = x-mx + (y-my) * p; gint mbit = x + y * mp; - __u32 color = (x-mx < 0 || y-my < 0 || + u32 color = (x-mx < 0 || y-my < 0 || x-mx >= stock_cursors[cursor_type].width || y-my >= stock_cursors[cursor_type].height) ? 0x00FFFFFF : (src[bit/8] & (1 << bit%8) ? 0 : 0x00FFFFFF); - __u8 a = color ? 0xE0 : 0xFF; - __u32 alpha = mask[mbit/8] & (1 << mbit%8) ? (a << 24) : 0; + u8 a = color ? 0xE0 : 0xFF; + u32 alpha = mask[mbit/8] & (1 << mbit%8) ? (a << 24) : 0; dst[x + y*pitch] = alpha | color; } -- 2.30.2